﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace datatool
{
    public class ByteData : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private byte _value;
        public int Offset { get; set; }
        public List<byte> AvailableValues { get; } = new List<byte> { 0, 1, 2, 3, 4, 5, 6 };
        public Action<byte> ValueChanged { get; set; }

        public byte Value
        {
            get => _value;
            set
            {
                if (_value != value)
                {
                    _value = value;
                    ValueChanged?.Invoke(value);
                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value)));
                }
            }
        }
    }
}
